package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@ToString
public class Operator {
    public static final byte STATE_NORMAL=0;
    public static final byte STATE_ADMIN=1;

    private Long id;

    private String username;//账号

    private String password;//密码

    private Role role;//职位

    private String state;//状态

    private Employee employee;//员工

    private int loginCount;//登陆次数
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date lastLoginTime;//登录时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;//录入时间

    private Byte admin=STATE_NORMAL;

    private List<Role> roles= new ArrayList<>();
    private String name;

    public String getName() {
        return name;
    }
}